home *** CD-ROM | disk | FTP | other *** search
- Path: news.mindspring.com!usenet
- From: rey@atl.mindspring.com (Dick Yuknavech)
- Newsgroups: comp.lang.c
- Subject: Re: Hiding a password
- Date: Sun, 03 Mar 1996 18:56:56 -0500
- Organization: No organization would have me
- Message-ID: <313a2f99.24058687@nntp3.mindspring.com>
- References: <1996Feb29.224936.137160@forest>
- NNTP-Posting-Host: rey.mindspring.com
- X-Newsreader: Forte Agent .99d/16.182
-
- ebromber@forest.drew.edu wrote:
-
- >I recently wrote a password program. However, there is one little flaw I
- >want to fix. When the password is entered, it is visible on the screen. I
- >was wondering if anyone knows how to hide the password by printing
- >asterisks instead of the actual character.
- >Thanks in advance.
-
- See if your runtime library contains a function called getpass(). It's
- standard on Unix and exists in the Borland C stuff for PC's. Beyond
- that, I can't say anything for sure, but I'll bet you a beer (Pete's
- Wicked Ale) that you've got it. Failing that, you'll have to use raw
- console I/O. Oops...getpass() works with 8-char (max) passwords. If
- that's why you didn't use it, then look at raw mode I/O in Unix, or
- getch() vs getche() in DOS.
- --
- Dick Yuknavech rey@mindspring.com
-